/*
 * ConstantBoolean.h
 *
 *  Created on: Feb 21, 2010
 *      Author: dhovemey
 */

#ifndef CONSTANTBOOLEAN_H_
#define CONSTANTBOOLEAN_H_

#include "vm/Constant.h"

/**
 * A boolean Constant.
 */
class ConstantBoolean : public Constant {
private:
	bool m_value;

	ConstantBoolean(const ConstantBoolean &);
	ConstantBoolean& operator=(const ConstantBoolean &);

public:
	/** Default constructor. */
	ConstantBoolean();

	/**
	 * Constructor.
	 * @param value boolean value of constant
	 */
	ConstantBoolean(bool value);

	/** Destructor. */
	virtual ~ConstantBoolean();

	/**
	 * Get boolean value of constant.
	 */
	bool getValue() const { return m_value; }

	virtual uint8_t getTagByte() const;
	virtual std::wstring asString(ConstantPool *cp) const;
	virtual void accept(IConstantVisitor *visitor);
	virtual bool compare(const Constant *other) const;
	virtual void read(DataInputStream *in);
	virtual void write(DataOutputStream *out) const;
};

#endif /* CONSTANTBOOLEAN_H_ */
